//package com.diorsunion.hedge.io.netty;
//
//import com.esotericsoftware.kryo.Kryo;
//import com.esotericsoftware.kryo.io.Input;
//import com.esotericsoftware.kryo.io.Output;
//import io.netty.buffer.ByteBuf;
//import io.netty.channel.ChannelHandlerAdapter;
//import io.netty.channel.ChannelHandlerContext;
//import io.netty.handler.codec.ByteToMessageDecoder;
//
//import java.io.FileOutputStream;
//import java.util.List;
//
///**
// * Created by harley-dog on 2016/5/17.
// */
//public class NettyMessageDecoder extends ChannelHandlerAdapter {
//    @Override
//    protected void decode(ChannelHandlerContext ctx, ByteBuf in, List<Object> out) throws Exception {
//        Kryo kryo = new Kryo();
//// ...
////        Output output = new Output(new FileOutputStream("file.bin"));
////        SomeClass someObject = ...
////        kryo.writeObject(output, someObject);
////        output.close();
//// ...
//        Input input = new Input();
//        SomeClass someObject = kryo.readObject(input, SomeClass.class);
//        input.close();
//
//        ByteBufToBytes read = new ByteBufToBytes();
//        Object obj = ByteObjConverter.byteToObject(read.read(in));
//        out.add(obj);
//    }
//}
